package com.ruoyi.system.api;

import com.ruoyi.common.core.constant.SecurityConstants;
import com.ruoyi.common.core.constant.ServiceNameConstants;
import com.ruoyi.common.core.domain.R;
import com.ruoyi.system.api.domain.SysDept;
import com.ruoyi.system.api.factory.RemoteDeptFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestParam;


/**
 * @author Redick01
 */
@FeignClient(contextId = "remoteDeptService", value = ServiceNameConstants.SYSTEM_SERVICE, fallbackFactory = RemoteDeptFallbackFactory.class)
public interface RemoteDeptService {

    /**
     * 查询部门
     *
     * @param deptName 部门数据
     * @param source   {@link String}
     * @return 部门
     */
    @GetMapping("/dept/selectDeptByName")
    public R<SysDept> selectDeptByName(@RequestParam("deptName") String deptName, @RequestParam("parentId") Long parentId, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);
}
